//
//  SLEBluetoothCMD.m
//  CollarMicrophone
//
//  Created by Yown on 2024/4/9.
//

#import "SLEBluetoothCMD.h"

@implementation SLEBluetoothCMD

- (NSData *)getHardwareConfig {
    Byte byteArr[] = {0xEE, 0x00, 0x00, 0xFF};
    NSData *data = [[NSData alloc] initWithBytes:byteArr length:sizeof(byteArr)];
    return data;
}

- (NSData *)getBattery {
    Byte byteArr[] = {0xEE, 0x09, 0x00, 0xFF};
    NSData *data = [[NSData alloc] initWithBytes:byteArr length:sizeof(byteArr)];
    return data;
}

- (NSData *)setMicrophoneMode:(NSUInteger)mode {
    Byte byteArr[] = {0xEE, 0x01, mode, 0xFF};
    NSData *data = [[NSData alloc] initWithBytes:byteArr length:sizeof(byteArr)];
    return data;
}

- (NSData *)setMicVol:(NSUInteger)vol {
    Byte byteArr[] = {0xEE, 0x02, vol, 0xFF};
    NSData *data = [[NSData alloc] initWithBytes:byteArr length:sizeof(byteArr)];
    return data;
}

- (NSData *)setMonitorVol:(NSUInteger)vol {
    Byte byteArr[] = {0xEE, 0x03, vol, 0xFF};
    NSData *data = [[NSData alloc] initWithBytes:byteArr length:sizeof(byteArr)];
    return data;
}

- (NSData *)setReverberation:(NSUInteger)vol {
    Byte byteArr[] = {0xEE, 0x04, vol, 0xFF};
    NSData *data = [[NSData alloc] initWithBytes:byteArr length:sizeof(byteArr)];
    return data;
}

- (NSData *)setNoiseReductionLevel:(NSUInteger)level {
    Byte byteArr[] = {0xEE, 0x05, level, 0xFF};
    NSData *data = [[NSData alloc] initWithBytes:byteArr length:sizeof(byteArr)];
    return data;
}

- (NSData *)setToneControl:(NSUInteger)toneControl {
    Byte byteArr[] = {0xEE, 0x06, toneControl, 0xFF};
    NSData *data = [[NSData alloc] initWithBytes:byteArr length:sizeof(byteArr)];
    return data;
}

- (NSData *)setDodge:(BOOL)isOpen {
    int byteState = isOpen ? 0x01 : 0x00;
    Byte byteArr[] = {0xEE, 0x07, byteState, 0xFF};
    NSData *data = [[NSData alloc] initWithBytes:byteArr length:sizeof(byteArr)];
    return data;
}

- (NSData *)setCancellingOriginalSound:(BOOL)isOpen {
    int byteState = isOpen ? 0x01 : 0x00;
    Byte byteArr[] = {0xEE, 0x08, byteState, 0xFF};
    NSData *data = [[NSData alloc] initWithBytes:byteArr length:sizeof(byteArr)];
    return data;
}

- (NSData *)setClassicalBLEOn:(BOOL)isOpen {
    int byteState = isOpen ? 0x01 : 0x00;
    Byte byteArr[] = {0xEE, 0x10, byteState, 0xFF};
    NSData *data = [[NSData alloc] initWithBytes:byteArr length:sizeof(byteArr)];
    return data;
}

@end
